//
//  TAMTMineController.swift
//  TAMeetApp
//
//  Created by Admin on 2024/12/1.
//

import UIKit
import SDCycleScrollView

class TAMTMineController: UIViewController {

    @IBOutlet weak var scrollerView: SDCycleScrollView!
    @IBOutlet weak var nickLabel: UILabel!
    
    @IBOutlet weak var czrightLabel: UILabel!
    @IBOutlet weak var czleftLabel: UILabel!
    @IBOutlet weak var czrightBtn: UIButton!
    @IBOutlet weak var czleftBtn: UIButton!
    @IBOutlet weak var sexBtn: UIButton!
    
    @IBOutlet weak var ipLabel: UILabel!
    @IBOutlet weak var numLabel: UILabel!
    @IBOutlet weak var subBottomView: UIView!
    @IBOutlet weak var subTopView: UIView!
    @IBOutlet weak var bigView: UIImageView!
    @IBOutlet weak var aihaoBtn: UIButton!
    @IBOutlet weak var signLabel: UILabel!
    @IBOutlet weak var fansLabel: UILabel!
    @IBOutlet weak var followLabel: UILabel!
    @IBOutlet weak var ageLabel: UILabel!
    @IBOutlet weak var tamtTopLayout: NSLayoutConstraint!

    @IBOutlet weak var addBtn: UIButton!
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        
        self.navigationController?.setNavigationBarHidden(true, animated: true)
    }
    
    override func viewDidLoad() {
        super.viewDidLoad()

        self.tamtTopLayout.constant = -TAMTAppUtils.shared.statusBarHeight
        
        sexBtn.layer.cornerRadius = 8
        sexBtn.layer.masksToBounds = true
        
        aihaoBtn.layer.cornerRadius = 10
        aihaoBtn.layer.masksToBounds = true
        
        addBtn.layer.cornerRadius = 10
        addBtn.layer.masksToBounds = true
        
        subBottomView.layer.cornerRadius = 12
        subBottomView.layer.masksToBounds = true
        
        subTopView.layer.cornerRadius = 12
        subTopView.layer.masksToBounds = true
        
        bigView.layer.cornerRadius = 12
        bigView.layer.masksToBounds = true
        
        czleftBtn.layer.cornerRadius = 10
        czleftBtn.layer.masksToBounds = true
        czleftBtn.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 0.5)
        
        czrightBtn.layer.cornerRadius = 10
        czrightBtn.layer.masksToBounds = true
        czrightBtn.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 0.5)
        
        czleftLabel.text = "￥45"
        czrightLabel.text = "￥128"
        
        sexBtn.backgroundColor = UIColor(red: 247/255.0, green: 89/255.0, blue: 171/255.0, alpha: 1)
        sexBtn.backgroundColor = UIColor(red: 85/255.0, green: 129/255.0, blue: 255/255.0, alpha: 1)
        sexBtn.setImage(UIImage(named: "sex_nan"), for: .selected)
        sexBtn.setImage(UIImage(named: "sex_nv"), for: .normal)
        
        ipLabel.text = "IP属地：深圳市"
        ipLabel.layer.cornerRadius = 8
        ipLabel.layer.masksToBounds = true
        ipLabel.layer.borderColor = UIColor(red: 151/255.0, green: 151/255.0, blue: 151/255.0, alpha: 1).cgColor
        ipLabel.layer.borderWidth = 0.5
        
        scrollerView.imageURLStringsGroup = ["https://c-ssl.duitang.com/uploads/blog/202106/18/20210618121911_6a098.jpg", "https://c-ssl.duitang.com/uploads/blog/202106/18/20210618121911_eafea.jpg"];
        scrollerView.bannerImageViewContentMode = .scaleAspectFill
        scrollerView.pageControlStyle = SDCycleScrollViewPageContolStyleAnimated
        scrollerView.pageControlAliment = SDCycleScrollViewPageContolAlimentRight
        
        self.signLabel.text = "这家伙很懒，什么也没留下";
        
        let setBtn = UIButton(type: .custom)
        setBtn.backgroundColor = UIColor(red: 1, green: 1, blue: 1, alpha: 0.5)
        setBtn.setImage(UIImage(named: "seting"), for: .normal)
        setBtn.addTarget(self, action: #selector(onSetupAction), for: .touchUpInside)
        setBtn.showsTouchWhenHighlighted = false
        setBtn.adjustsImageWhenHighlighted = false
        setBtn.layer.cornerRadius = 19
        setBtn.layer.masksToBounds = true
        self.view.addSubview(setBtn)
        setBtn.snp.makeConstraints { make in
            make.top.equalTo(TAMTAppUtils.shared.statusBarHeight)
            make.trailing.equalTo(-12)
            make.size.equalTo(CGSize(width: 38, height: 38))
        }
    }

    @objc func onSetupAction() {
        self.navigationController?.pushViewController(TAMTSettingController(), animated: true)
    }
    
    @IBAction func onAddLikesAction() {
    }
    
    @IBAction func onEditInfoAction(_ sender: UIButton) {
        self.navigationController?.pushViewController(TAMTMyProfileController(), animated: true)
    }
    @IBAction func onHistoryAction() {
        self.navigationController?.pushViewController(TAMTHistoryController(), animated: true)
    }
    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
